<template>
	<view class="bg-color-item pa-12 br-12  mb-12" @click="toPage">
		<view class="title flex">
			<w-image :src='appConfig.appLogo' width="16" height="16" shape="circle"></w-image>
			<text class="issuer-name font-size-12 ml-4 font-color-textPrimary">{{handleLang(appConfig.appName)}}</text>
		</view>
		<w-image class='mt-12' width="319" height="179" :src='item.list_image' radius="12"></w-image>
		<view class="pt-16 pb-8 font-color-textPrimary font-w-600">
			{{handleLang(item.name)}}
		</view>
		<view class="font-color-minor font-size-12">
			{{item.createtime|formatDate}}
		</view>
	</view>
</template>

<script>
	export default {
		name: "w-activity-card",
		props: {
			item: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			toPage() {
				let {
					link_page
				} = this.item
				if (link_page) {
					if (String(link_page).startsWith('/pages')) {
						this.$u.route(link_page)
					} else if (String(link_page).startsWith('https://mp.weixin.qq.com/')) {
						// #ifdef H5
						window.location.href = link_page
						// #endif
						// #ifdef APP-PLUS
						this.toLocalWebview(link_page)
						// #endif
					} else {
						this.toLocalWebview(link_page)
					}
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
